Change deprecated `File.exists?` to `File.exist?`.

Pointed out in #595.

Akinori MUSHA 9 years ago
parent
commit
002436fcb0

+ 1 - 1
app/helpers/agent_helper.rb

@@ -1,7 +1,7 @@
1 1
 module AgentHelper
2 2
   def agent_show_view(agent)
3 3
     name = agent.short_type.underscore
4
-    if File.exists?(Rails.root.join("app", "views", "agents", "agent_views", name, "_show.html.erb"))
4
+    if File.exist?(Rails.root.join("app", "views", "agents", "agent_views", name, "_show.html.erb"))
5 5
       File.join("agents", "agent_views", name, "show")
6 6
     end
7 7
   end

+ 1 - 1
bin/setup_heroku

@@ -56,7 +56,7 @@ def set_value(key, value, options = {})
56 56
   end
57 57
 end
58 58
 
59
-unless File.exists?(File.expand_path("~/.netrc")) && File.read(File.expand_path("~/.netrc")) =~ /heroku/
59
+unless File.exist?(File.expand_path("~/.netrc")) && File.read(File.expand_path("~/.netrc")) =~ /heroku/
60 60
   puts "It looks like you need to log in to Heroku.  Please run 'heroku auth:login' before continuing."
61 61
   exit 1
62 62
 end

+ 1 - 1
config/boot.rb

@@ -3,4 +3,4 @@ require 'rubygems'
3 3
 # Set up gems listed in the Gemfile.
4 4
 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5 5
 
6
-require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
6
+require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

+ 1 - 1
deployment/site-cookbooks/huginn_production/files/default/unicorn.rb

@@ -20,7 +20,7 @@ before_fork do |server, worker|
20 20
   defined?(ActiveRecord::Base) and
21 21
     ActiveRecord::Base.connection.disconnect!
22 22
   old_pid = "#{server.config[:pid]}.oldbin"
23
-  if File.exists?(old_pid) && server.pid != old_pid
23
+  if File.exist?(old_pid) && server.pid != old_pid
24 24
     begin
25 25
       Process.kill("QUIT", File.read(old_pid).to_i)
26 26
     rescue Errno::ENOENT, Errno::ESRCH

+ 1 - 1
doc/deployment/unicorn/production.rb

@@ -19,7 +19,7 @@ pid '/home/you/app/shared/pids/unicorn.pid'
19 19
 before_fork do |server, worker|
20 20
   ActiveRecord::Base.connection.disconnect!
21 21
   old_pid = "#{server.config[:pid]}.oldbin"
22
-  if File.exists?(old_pid) && server.pid != old_pid
22
+  if File.exist?(old_pid) && server.pid != old_pid
23 23
     begin
24 24
       Process.kill("QUIT", File.read(old_pid).to_i)
25 25
     rescue Errno::ENOENT, Errno::ESRCH